import type { InjectionKey } from "vue";
import type { ListProps } from "../config";
import type {rectSize } from '../utils'

export interface ListContext {
	props: Required<ListProps>;
	innerScrollTop: number;
	children:ListItemContext[];
	addField: (field: ListItemContext) => void;
	removeField: (field: ListItemContext) => void;
	getChildIndex: (id: string) => number;
	updateOffsetFromChild(top: number): void;
}

export interface ListItemContext {
	id: string,
	rect:rectSize,
	item:any
}

export const listItemContextKey: InjectionKey<ListItemContext> = Symbol(
	"EListItemContextKey"
);
export const listContextKey: InjectionKey<ListContext> =
	Symbol("EListContextKey");
